#!/bin/bash
# Program:
#	Use loop to calculate "1+2+3+4.....+100" result.
# History:
# 2017/11/14	jasonzh	v1

PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH

read -p "Please input a number, I will count for 1+2+3....+your_input:" nu
s=0
for ((i=1;i<=${nu};i++))
do
	s=$((${s}+${i}))
done
echo "The result of '1+2+3...+${nu}' is ==> ${s}"
